<template>
  <div class="userOverallSituation" v-show="dialogFormVisible">
    <div class="GeneralPurposeCSS" style="border-top: 1px solid #ccc;">个 人</div>
    <div class="GeneralPurposeCSS" @click="insertArticle">添加文章</div>
    <div class="GeneralPurposeCSS">关 于</div>
    <div class="GeneralPurposeCSS" @click="backstage">后 台</div>
    <div class="GeneralPurposeCSS" @click="userClose">注 销</div>
  </div>
</template>

<script>
//个人的选项列表
export default {
  name: "UserModules",
  data(){
    return{
      dialogFormVisible: false
    }
  },
  methods:{
    showuser(){
      this.dialogFormVisible = true;
    },
    overuser(){
      this.dialogFormVisible = false;
    },
    //注销
    userClose(){
      this.$confirm('是否退出登录?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.axios.post(this.Global.BASE_URL+'/login/LogOut').then((res)=>{
          if("2000" == res.data.msg || "4000" == res.data.msg){
            this.$emit("UserClose",1);
            this.$CustomMessage_OK('注销','注销成功！');
          }
          else this.$CustomMessage_ERROR('注销','注销错误！');
        }).catch(erroe=>{
          this.$CustomMessage_ERROR('注销','注销错误！');
        })
      }).catch(() => {});
    },
    //添加（从父级来到子级这里，再由子级调用父级方法）
    insertArticle(){
      this.$parent.ShowOverArticles(1);
    },
    //后台
    backstage(){
      window.location.replace("/BackstageContent");
    }
  }
}
</script>

<style scoped>
.userOverallSituation{
  padding: 10px 10px;
  background: white;
  border: 2px solid #e5e9f2;
  border-radius: 7px;
}
.GeneralPurposeCSS{
  padding-top: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ccc;
  text-align: center;
  cursor: pointer;
}
</style>
